<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="__STATIC__/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
</head>
<body class="gray-bg">
{include file="comm/left"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>订购 <small>详情</small></h5>
                    <div class="ibox-tools">
                        <div class="switch">
                            <div class="onoffswitch">
                                <input type="checkbox"  class="onoffswitch-checkbox" {if $status==0}checked disabled {/if} id="status">
                                <label class="onoffswitch-label" for="status">
                                    <span class="onoffswitch-inner"></span>
                                    <span class="onoffswitch-switch"></span>
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-tools">
                        一键处理：
                    </div>
                </div>
                <div class="ibox-content">

                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th width=7%>编号</th>
                            <th width=10%>订购人</th>
                            <th>订购信息</th>
                            <th width=10%>订购时间</th>
                            <th width=7%>是否处理</th>
                            <th width=7%>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach $order as $k}
                        <tr class="gradeX" width="90px">
                            <th>{$i++}</th>
                            <th>{$k.userid}</th>
                            <th>{$k.txt}</th>
                            <th>{$k.create_time}</th>
                            <th>
                                <div class="switch">
                                    <div class="onoffswitch">
                                        <input type="checkbox" {if $k.status=="1" }checked disabled {/if} class="onoffswitch-checkbox zhuangtai" id="{$k.id}">
                                        <label class="onoffswitch-label" for="{$k.id}">
                                            <span class="onoffswitch-inner"></span>
                                            <span class="onoffswitch-switch"></span>
                                        </label>
                                    </div>
                                </div>
                            </th>
                            <th>
                                <a  href="javascript:;" onclick="deletel('{:url('index/submessages/del')}',{$k.id})" class="btn btn-warning del"><i class="fa fa-warning"></i><span class="bold">删除</span></a>
                            </th>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__STATIC__/js/jquery.min.js?v=2.1.4"></script>
<script src="__STATIC__/js/bootstrap.min.js?v=3.3.5"></script>
<script src="__STATIC__/js/plugins/jeditable/jquery.jeditable.js"></script>
<script src="__STATIC__/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="__STATIC__/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="__STATIC__/js/content.min.js?v=1.0.0"></script>
<script>
    $(function(){
        $('#status').click(function(){
            var btn=$(this);
            var url="{:url('index/submessages/updallstatus')}";
            $.post(url,{type:2},function(){
                btn.attr('disabled','disabled');
                location.reload();
            });
        });
    });
    $(function(){
        $('.zhuangtai').click(function(){
            var btn=$(this);
            var id=$(this).attr('id');
            var url="{:url('index/submessages/updstatus')}";
            $.post(url,{id:id},function(){
                btn.attr('disabled','disabled');
            });
        });
    });
    $(document).ready(function(){$(".dataTables-example").dataTable();var oTable=$("#editable").dataTable();oTable.$("td").editable("../example_ajax.php",{"callback":function(sValue,y){var aPos=oTable.fnGetPosition(this);oTable.fnUpdate(sValue,aPos[0],aPos[1])},"submitdata":function(value,settings){return{"row_id":this.parentNode.getAttribute("id"),"column":oTable.fnGetPosition(this)[2]}},"width":"90%","height":"100%"})});function fnClickAddRow(){$("#editable").dataTable().fnAddData(["Custom row","New row","New row","New row","New row"])};
</script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
</body>
</html>
